
<?php


 /**
  * CustomerProduct Value Object.
  * This class is value object representing database table CustomerProduct
  * This class is intented to be used together with associated Dao object.
  */


class CustomerProduct {

    /** 
     * Persistent Instance variables. This data is directly 
     * mapped to the columns of database table.
     */
    var $CustomerProductID;
    var $TicketID;
    var $ProductDetailsID;



    /** 
     * Constructors. 
     * The first one takes no arguments and provides the most simple
     * way to create object instance. The another one takes one
     * argument, which is the primary key of the corresponding table.
     */

    function CustomerProduct () {

    }

    /* function CustomerProduct ($CustomerProductIDIn) {

          $this->CustomerProductID = $CustomerProductIDIn;

    } */


    /** 
     * Get- and Set-methods for persistent variables. The default
     * behaviour does not make any checks against malformed data,
     * so these might require some manual additions.
     */

    function getCustomerProductID() {
          return $this->CustomerProductID;
    }
    function setCustomerProductID($CustomerProductIDIn) {
          $this->CustomerProductID = $CustomerProductIDIn;
    }

    function getTicketID() {
          return $this->TicketID;
    }
    function setTicketID($TicketIDIn) {
          $this->TicketID = $TicketIDIn;
    }

    function getProductDetailsID() {
          return $this->ProductDetailsID;
    }
    function setProductDetailsID($ProductDetailsIDIn) {
          $this->ProductDetailsID = $ProductDetailsIDIn;
    }



    /** 
     * setAll allows to set all persistent variables in one method call.
     * This is useful, when all data is available and it is needed to 
     * set the initial state of this object. Note that this method will
     * directly modify instance variales, without going trough the 
     * individual set-methods.
     */

    function setAll($CustomerProductIDIn,
          $TicketIDIn,
          $ProductDetailsIDIn) {
          $this->CustomerProductID = $CustomerProductIDIn;
          $this->TicketID = $TicketIDIn;
          $this->ProductDetailsID = $ProductDetailsIDIn;
    }


    /** 
     * hasEqualMapping-method will compare two CustomerProduct instances
     * and return true if they contain same values in all persistent instance 
     * variables. If hasEqualMapping returns true, it does not mean the objects
     * are the same instance. However it does mean that in that moment, they 
     * are mapped to the same row in database.
     */
    function hasEqualMapping($valueObject) {

          if ($valueObject->getCustomerProductID() != $this->CustomerProductID) {
                    return(false);
          }
          if ($valueObject->getTicketID() != $this->TicketID) {
                    return(false);
          }
          if ($valueObject->getProductDetailsID() != $this->ProductDetailsID) {
                    return(false);
          }

          return true;
    }



    /**
     * toString will return String object representing the state of this 
     * valueObject. This is useful during application development, and 
     * possibly when application is writing object states in textlog.
     */
    function toString() {

        $out = $out."\nclass CustomerProduct, mapping to table CustomerProduct\n";
        $out = $out."Persistent attributes: \n"; 
        $out = $out."CustomerProductID = ".$this->CustomerProductID."\n"; 
        $out = $out."TicketID = ".$this->TicketID."\n"; 
        $out = $out."ProductDetailsID = ".$this->ProductDetailsID."\n"; 
        return $out;
    }


    /**
     * Clone will return identical deep copy of this valueObject.
     * Here, the retuned cloned object will also have all its attributes cloned.
     */
    function clone1() {
        $cloned = new CustomerProduct();

        $cloned->setCustomerProductID($this->CustomerProductID); 
        $cloned->setTicketID($this->TicketID); 
        $cloned->setProductDetailsID($this->ProductDetailsID); 

        return $cloned;
    }

}

?>
